define(['./../initial', './../model/Project', './../controller/metro/metro.quickbarCtrl', './../controller/metro/metro.menu.headerCtrl'], function() {
    var app = angular.module('App');
    app.config(['$stateProvider', '$urlRouterProvider', '$locationProvider',
        function($stateProvider, $urlRouterProvider, $locationProvider) {
            $stateProvider
                .state('metro', {
                    url: "/metro",
                    resolve: {
                        //提前获取权限项目
                        Project: "Project",
                        typeList: ["Project", function(Project) {
                            return Project.getTypes();
                        }],
                        allLines: ["Project", "typeList", function(Project, typeList) {
                            var type = window.localStorage.getItem('projectType') || typeList[0].typeCode;
                            return Project.getAllCityProjects(type);
                        }]
                    },
                    views: {
                        "quickbar@": {
                            templateUrl: "/partials/metro/metro/quickbar",
                            controller: "metro.quickbarCtrl"
                        },
                        "header-menu@": {
                            controller: 'metro.menu.headerCtrl',
                            templateUrl: "/partials/metro/header-menu"
                        }
                    }
                });
        }
    ]);
});